package com.dogstalks.main;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.view.View;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

public class GeoTaggingOverlay extends Overlay {
	private List<OverlayItem> items = new ArrayList<OverlayItem>();
	private Drawable marker = null;
	private Bitmap mGeoBitmap;
	private Location mLocation;
	private GeoPoint mGeoPoit ;
	
	public void setBtimp(Bitmap bitmap, GeoPoint point){ //Location location
		this.mGeoBitmap = bitmap;
		this.mGeoPoit = point;
	}
	
	@Override
	public void draw(Canvas canvas, MapView mapView, boolean shadow) {
		// TODO Auto-generated method stub
		super.draw(canvas, mapView, shadow);
		
	    // Convert geo coordinates to screen pixels
	    Point screenPoint = new Point();
	    mapView.getProjection().toPixels(mGeoPoit, screenPoint);
	    
	    canvas.drawBitmap(mGeoBitmap,
	        screenPoint.x - mGeoBitmap.getWidth(),
	        screenPoint.y - mGeoBitmap.getHeight(), null);
	}


}
